//
// Created by root on 19-10-16.
//

#ifndef OPENGLESPRO_GAME_H
#define OPENGLESPRO_GAME_H

#define PI 3.141592653589793238462643383279502884L

#define GLSL_BUFFER_SIZE 2048
#define GLSL_VERTEX_SHADER_FILE_NAME "game/vertex_game_step_7.glsl"
#define GLSL_FRAGMENT_SHADER_FILE_NAME "game/fragment_game_step_7.glsl"
#define GLES_METHOD_ON_SURFACE_CREATED OnSurfaceCreatedV7();
#define GLES_METHOD_ON_SURFACE_CHANGED OnSurfaceChangedV7();
#define GLES_METHOD_ON_DRAW_FRAME OnDrawFrameV7();

#include <GLES3/gl3.h>
#include <jni.h>

struct Device {
    int width;
    int height;
    GLuint program;
    JNIEnv *jniEnv;
    jobject bitmap;
    jobject assetManager;
};
static Device device;

class game {
private:
public:
    void OnSurfaceCreated();

    void OnSurfaceChanged(int width, int height);

    void OnDrawFrame();
};

#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT void JNICALL
Java_com_andova_game_SampleGameRender_onSurfaceCreated(JNIEnv *env, jobject, jobject assetManager,
                                                       jobject bitmap);

JNIEXPORT void JNICALL
Java_com_andova_game_SampleGameRender_onSurfaceChanged(JNIEnv *, jobject, jint w, jint h);

JNIEXPORT void JNICALL
Java_com_andova_game_SampleGameRender_onDrawFrame(JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif


#endif //OPENGLESPRO_GAME_H
